import request from '@/utils/request'

// 获取部门列表
export const getDepartmentsListApi = () => {
  return request.get('/company/department')
}

// 删除部门
export const delDepartmentsApi = (id) => {
  return request.delete(`/company/department/${id}`)
}

// 获取部分负责人列表
export const getUserSimpleListApi = () => {
  return request.get('/sys/user/simple')
}

// 新增部门
export const addDepartmentApi = form => {
  return request({
    url: '/company/department',
    method: 'post',
    data: form
  })
}

// 获取部分详情
export const getDepartmentDetailApi = id => {
  return request.get(`/company/department/${id}`)
}

// 修改部门
export const editDepartmentApi = data => {
  return request(
    { url: `/company/department/${data.id}`,
      method: 'put',
      data
    }
  )
}
